package czk.concrent.review;

import java.util.concurrent.TimeUnit;

/**
 * @Author:ChenZhangKun
 * @Date: 2020/6/22 23:04
 */
public class Practice {
    public static void main(String[] args) {
        Thread t1= new Thread(()->{
            try {
                TimeUnit.SECONDS.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        t1.start();
        System.out.println("线程t1开始运行了");
        try {
            // time小于10时，等完time就往下运行
            // time大雨十秒时，t1结束就继续往下运行
            t1.join(20*1000);
            System.out.println("接着往下进行");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
